Installed the fasta_classify_catpack subworkflow#38
Conversation
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 3.5.1. For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation. |
|
| // Database preparation | ||
| // | ||
|
|
||
| // Handle pre-built db: untar if compressed, or use directory directly |
There was a problem hiding this comment.
@mberacochea that part was not working for input as directory. Directory doesn't have .name in nextflow. I have fixed it by checking instance. Maybe push that fix to nf-core 😱
There was a problem hiding this comment.
OK, I'll fix it there. Can you create the patch please?
There was a problem hiding this comment.
Later.. I'm still testing.
One more note: we need to check input DB directory for structure. You are expecting db and tax subfolders inside. It is not obvious and should be checked and described in subwf
b0b3b81 to
1ffbcb7
Compare
conf/modules.config
Outdated
| withName: 'CATPACK_ADDNAMES_BINS' { | ||
| ext.args = '--only_official' | ||
| publishDir = [ | ||
| path: { "${params.outdir}/${params.mode}/taxonomy" }, | ||
| mode: params.publish_dir_mode, | ||
| pattern: "*bin2classification*.txt", | ||
| saveAs: { filename -> filename.equals('versions.yml') ? null : filename } | ||
| ] | ||
| } |
There was a problem hiding this comment.
This publishDir won't work because file is currently called "${meta.id}".txt
conf/modules.config
Outdated
| withName: 'CATPACK_SUMMARISE_BINS' { | ||
| ext.prefix = "bins_summary" | ||
| publishDir = [ | ||
| path: { "${params.outdir}/${params.mode}/taxonomy" }, | ||
| mode: params.publish_dir_mode, | ||
| pattern: "*_summary.txt", | ||
| saveAs: { filename -> filename.equals('versions.yml') ? null : filename } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Do you think we need to run this module? I think it's unnecessary...
There was a problem hiding this comment.
I was not sure about it... I can make it 'false'
| """ | ||
| input[0] = [ | ||
| [ id: 'test' ], | ||
| file("${projectDir}/modules/local/rename_fasta_for_catpack/tests/test.fasta", checkIfExists: true) |
There was a problem hiding this comment.
| file("${projectDir}/modules/local/rename_fasta_for_catpack/tests/test.fasta", checkIfExists: true) | |
| file("${moduleDir}/tests/test.fasta", checkIfExists: true) |
| script: | ||
| def is_compressed = fasta.name.endsWith('.gz') | ||
| extension = '.fasta' | ||
| def base = fasta.name | ||
| .replaceAll(/\.gz$/, '') | ||
| .replaceAll(/\.(fa|fasta|fna)$/, '') | ||
| def output_name = base + extension | ||
|
|
||
| if (is_compressed) { | ||
| """ | ||
| mkdir -p output | ||
| gunzip -c ${fasta} > output/${output_name} | ||
| """ | ||
| } else { | ||
| """ | ||
| mkdir -p output | ||
| ln -s ../${fasta} output/${output_name} | ||
| """ | ||
| } |
| tuple val(meta), path(fasta) | ||
|
|
||
| output: | ||
| tuple val(meta), path("output/*.fasta{,.gz}"), emit: renamed_fasta |
There was a problem hiding this comment.
You uncompress all gz, so it's always just .fasta
| - "output/*.fasta{,.gz}": | ||
| type: file | ||
| description: | | ||
| Renamed FASTA file with a .fasta extension, decompressed if the input was compressed. | ||
| pattern: "output/*.fasta{,.gz}" |
nextflow.config
Outdated
|
|
||
| // NCBI taxonomy | ||
| cat_db = null | ||
| cat_db_download_id = '' |
There was a problem hiding this comment.
Why '' and not null? Why it doesn't have default value like checkm2_db_zenodo_id?
There was a problem hiding this comment.
because I didn't search for it... 🤦♀️
3fb2e0a to
3cd524a
Compare
Taxonomy part
fasta_classify_catpackfrom nf-core.fastaextension required for CAT_pack as input